function hasValue(str) {
	return str.length != 0;
}

function getQueryStr(params) {
	var paramsStr = '';
	for (i = 0; i < params.length; i++) {
		paramsStr += '&' + params[i];
	}
	var queryStr = 'StockCtrl?' + paramsStr;

	/*
	 * var url = window.location.href; var startStr = 'stock/'; var start =
	 * url.indexOf(startStr, 0); alert(start); var end = url.indexOf('?', 0);
	 * alert(end); var page = url.substring(start + startStr.length,
	 * url.length); if(end>=0){ if(url.HasProperty('page')) page =
	 * url.substring(start + startStr.length, end); } queryStr += '&page='+page;
	 */
	// alert(queryStr);
	return queryStr;
}

function submitForm(formId, params) {
	var form = document.forms[formId];
	var temp = form.action;
	var queryStr = getQueryStr(params);
	form.action = queryStr;
	form.submit();
	form.action = temp;
}

function getCookie(c_name) {
	var i, x, y, ARRcookies = document.cookie.split(";");
	for (i = 0; i < ARRcookies.length; i++) {
		x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
		y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
		x = x.replace(/^\s+|\s+$/g, "");
		if (x == c_name) {
			return unescape(y);
		}
	}
}
function getQueryString(item){
	var svalue = location.search.match(new RegExp("[\?\&]" + item + "=([^\&]*)(\&?)","i"));
	return svalue ? svalue[1] : svalue;
}

